package com.example.demo.common;

import java.util.Objects;

public class Field {

    // 成员属性类型
    private String fieldType;
    // 成员属性名称
    private String fieldName;

    public String getFieldType() {
        return fieldType;
    }

    public void setFieldType(String fieldType) {
        this.fieldType = fieldType;
    }

    public String getFieldName() {
        return fieldName;
    }

    public String getFieldName2() {
        String firstChar = fieldName.substring(0, 1);
        return firstChar.toUpperCase() + fieldName.substring(1);
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Field field = (Field) o;
        return Objects.equals(fieldName, field.fieldName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(fieldType, fieldName);
    }
}
